#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

char b[33];
int a;

int main() {
    a = 0;//b31 b30 b29....b0=0 0 0 0 0...0
    cin >> b;
    reverse(b, b + 32);

    for (int i = 31; i >= 0; i--) {
        if (b[i] == '1') {
            a |= (1 << i);
        }

    }
    cout << a;

    return 0;
}